import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/components/HomeView.vue'
import AdminLogin from '@/components/AdminLogin.vue'
import StaffLogin from '@/components/StaffLogin.vue'
import AdminView from '@/components/AdminView.vue'
import StaffView from '@/components/StaffView.vue'
import MeetingManage from '../views/MeetingManage.vue';
import ClientManage from '../views/ClientManage.vue';
import StaffManage from '../views/StaffManage.vue';
import AuditManage from '../views/AuditManage.vue';
import StatsManage from '../views/StatsManage.vue';
import SalesStats from '../views/SalesStats.vue';
import StaffMeetingManage from '../views/StaffMeetingManage.vue';
import StaffWorkLog from '../views/StaffWorkLog.vue';
import StaffOrderReview from '../views/StaffOrderReview.vue';
const routes = [
  {
    path: '/',
    name: 'Home',
    component: HomeView
  },
  {
    path: '/admin-login',
    name: 'AdminLogin',
    component: AdminLogin
  },
  {
    path: '/staff-login',
    name: 'StaffLogin',
    component: StaffLogin
  },
  {
    path: '/admin-view',
    name: 'AdminView',
    component: AdminView
  },
  {
    path: '/staff-view',
    name: 'StaffView',
    component: StaffView

  },
  {
    path: '/admin',
    component: AdminView,
    children: [
      { path: 'meeting', component: MeetingManage },
      { path: 'client', component: ClientManage },
      { path: 'staff', component: StaffManage },
      { path: 'audit', component: AuditManage },
      { path: 'stats', component: StatsManage },
      { path:'sales', component: SalesStats }
    ],
  },
  {
    path: '/staff',
    component: StaffView,
    children: [
      { path: 'meeting', component: StaffMeetingManage },
      { path: 'worklog', component: StaffWorkLog },
      { path: 'order', component: StaffOrderReview }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
